import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;

public class Demo_1002 {
    public static void main(String[] args) {
        //原子类
        AtomicInteger atomicInteger = new AtomicInteger();

        //获取当前的值 0
        System.out.println(atomicInteger.get());
        //自增 i++  1
        atomicInteger.getAndIncrement();
        System.out.println(atomicInteger.get());
        //自增 ++i  2
        System.out.println(atomicInteger.incrementAndGet());
        //自减 i--  1
        atomicInteger.getAndDecrement();
        System.out.println(atomicInteger.get());
        //自减 --i  0
        System.out.println(atomicInteger.getAndDecrement());
        //累加 i+x    x = 100
        atomicInteger.getAndAdd(100);
        System.out.println(atomicInteger.get());

        System.out.println(UUID.randomUUID());
        System.out.println(UUID.randomUUID());
        System.out.println(UUID.randomUUID());
        System.out.println(UUID.randomUUID());
        System.out.println(UUID.randomUUID());
        System.out.println(UUID.randomUUID());

    }
}
